# Load Necessary Packages
library(meta)
library(dmetar)

## Effect sizes come from regressions
# Pooled Effects
injunctive <- data.frame(Author=c("US","UK","Canada"),
                         TE=c(0.015485673,0.021081615,0.074430052),
                         seTE=c(0.01926113,0.04132695,0.05035338),
                         n.e=c(784,1279,497),
                         n.c.=c(640,955,438))

contention <- data.frame(Author=c("US","UK","Canada"),
                         TE=c(-0.006693034,-0.008901815,-0.005401044),
                         seTE=c(0.02279862,0.04369964,0.05298167),
                         n.e=c(601,956,380),
                         n.c.=c(640,955,438))

m.injunctive <- metagen(TE=TE,seTE=seTE,studlab=Author,data=injunctive,sm="MD",comb.fixed=F,comb.random=T,method.tau="REML",hakn=T,title="Injunctive")
m.contention <- metagen(TE=TE,seTE=seTE,studlab=Author,data=contention,sm="MD",comb.fixed=F,comb.random=T,method.tau="REML",hakn=T,title="Injunctive")
